
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

unsigned int get_tokens(int *num_tokens, char* tokens[]) {

	  char str[1024];
      unsigned int k,cmd;
      cmd =0;
      *num_tokens = 0;

	  gets(str);

	  tokens[0] = (char *)strtok (str," \t\n\r");

	  while(tokens[*num_tokens] != NULL)
	  {
		*num_tokens = *num_tokens + 1;
	    tokens[*num_tokens] = (char *)strtok (NULL, "  \t\r\n");
	  }

    	for(k=0; k < *num_tokens; k++) {

            if(!strcmp(tokens[k],"|")) {
            	cmd = 69 ;
            	break;
            }

            if(!strcmp(tokens[k],"&")) {
                   cmd = 31 ;
                   break;
            }

        }

	  return cmd;
}
